package top.drinyeit.weilong.activity;

import android.os.Bundle;
import android.widget.ListView;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

import top.drinyeit.weilong.R;
import top.drinyeit.weilong.adapter.PaymentDetailsAdapter;
import top.drinyeit.weilong.base.BaseActivity;
import top.drinyeit.weilong.model.BalanceDetailBean;
import top.drinyeit.weilong.presenter.PaymentDetailsPresenter;

/**
 * Created by bigHead on 2017/11/21.
 */

public class PaymentDetailsActivity extends BaseActivity{
    private ListView pay_ListView;
    private List<BalanceDetailBean> list;
    PaymentDetailsAdapter paymentDetailsAdapter;

    private PaymentDetailsPresenter paymentDetailsPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_payment_details);

        pay_ListView = findViewById(R.id.pay_ListView);

        initData();

        setTitle(true,"收支明细");

    }

    public void initData(){
        paymentDetailsPresenter = new PaymentDetailsPresenter(this);
        initList();
    }

    public void initList() {
        list = new ArrayList<>();
        paymentDetailsAdapter = new PaymentDetailsAdapter(this,list);
        pay_ListView.setAdapter(paymentDetailsAdapter);
        paymentDetailsPresenter.getBlDe();
    }

    public ListView getPay_ListView() {
        return pay_ListView;
    }

    public List<BalanceDetailBean> getList() {
        return list;
    }
}
